<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<c:set var="path" value="..${ctx}/common"/>

<c:set var="page" value="${userPage}" />
<form id="pagerForm" method="post" action="${path}/action.html?name=sys_user_list&jsp=base/user/list">
	<input type="hidden" name="currentPage" value="${page.currentPage}" />
	<input type="hidden" name="pageSize" value="${page.pageSize}" />
	<input type="hidden" name="USER_NAME" value="${USER_NAME}" />
	<input type="hidden" name="REAL_NAME" value="${REAL_NAME}" />
</form>

<div class="pageContent" >
	<div class="pageHeader">
		<form id="bs_user_list" onsubmit="return navTabSearch(this);" action="${path}/action.html?name=sys_user_list&jsp=base/user/list" method="post">
		<div class="searchBar">
			<table class="searchContent">
				<tr>
					<td>用户名：</td>
					<td>
						<input type="text" name="USER_NAME" value="${USER_NAME}" />
					</td>
					<td>用户姓名：</td>
					<td>
						<input type="text" name="REAL_NAME" value="${REAL_NAME}" />
					</td>
					<td>工作组：</td>
					<td>
						<input type="text" name="groups" value="${groups}" />
						<input type="hidden" name="CALL_SIGN_link" value="=" />
					</td>
					<td>
						<div class="buttonActive"><div class="buttonContent"><button type="submit">检索</button></div></div>
					</td>
				</tr>
			</table>
		</div>
		</form>
	</div>

	<div class="panelBar">
		<ul class="toolBar">
			<li><a class="add" href="${path}/action.html?name=sys_user_load&jsp=base/user/edit" target="dialog" rel="dlg_page10" mask="true" title="添加平台用户信息" width="500" height="340" ><span>添加</span></a><br /><br /></li>
			<li class="line">line</li>
			<li><a class="edit" href="${path}/action.html?name=sys_user_load&jsp=base/user/edit&USER_ID={userID}" target="dialog" rel="dlg_page11" mask="true" title="修改平台用户信息"><span>修改</span></a></li>
			<li class="line">line</li>
			<li><a class="delete" href="${path}/update.html?tableName=SYS_USER&tableAction=delete&jsp=base/user/edit&USER_ID={userID}" target="ajaxTodo" title="确定要删除吗?"><span>删除</span></a></li>
		</ul>
	</div>
	<table class="table" width="100%" layoutH="110">
		<thead>
			<tr>
				<th width="80">用户编号</th>
				<th width="80">用户名</th>
				<th width="120">用户姓名</th>
				<th width="80">上次登录时间</th>
				<th width="120">工作组</th>
				<th width="120">角色</th>
			</tr>

		</thead>
			<tbody>
			<c:if test="${! empty page.records }">
			<c:forEach var="vo" items="${page.records}">
			<tr target="userID" rel="${vo.USER_ID}">
				<td>${vo.USER_ID}</td>
				<td>${vo.USER_NAME}</td>
				<td>${vo.REAL_NAME}</td>
				<td>${vo.LAST_LOGIN_TIME}</td>
				<td>${vo.GROUPS}</td>
				<td>
				<c:set var="rolenames"  value="" />
				<c:if test="${ ! empty vo.ROLES}">
				<c:set var="_roles"  value="${fn:split(vo.ROLES,',')}" />
				<c:forEach var="_role" items="${_roles}">
					<c:set var="rolenames"  value="${rolenames},${roleMap[_role].ROLE_NAME}" />
				</c:forEach>
				<c:set var="rolenames"  value="${fn:substring(rolenames, 1, fn:length(rolenames))}" />
				</c:if>
				${rolenames}</td>
			</tr>
			</c:forEach>
			</c:if>
		</tbody>
	</table>
	
	<div class="panelBar">
		<div class="pages">
			<span>显示</span>
			<select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
				<option value="15" <c:if test="${page.pageSize==15}">selected</c:if> >15</option>
				<option value="30" <c:if test="${page.pageSize==30}">selected</c:if> >30</option>
				<option value="50" <c:if test="${page.pageSize==50}">selected</c:if> >50</option>
			</select>
			<span>条，共${page.recordCount}条,共${page.pageCount}页，每页${page.pageSize}条，当前第${page.currentPage}页</span>
		</div>
		<div class="pagination" targetType="navTab" totalCount="${page.recordCount}" numPerPage="${page.pageSize}" pageNumShown="4" currentPage="${page.currentPage}"></div>
	</div>

</div>
